/*
 * Planet.cpp
 *
 *  Created on: 16/04/2013
 *      Author: Vitor
 */

#include "Planet.h"

Planet::Planet(Sprite* sprite, int hitPoints, float x, float y) :
		GameObject(x, y, sprite->getWidth(), sprite->getHeight()) {
	this->sprite = sprite;
	this->hitPoints = hitPoints;
}

void Planet::render(float cameraX, float cameraY) {
	if (sprite)
		sprite->render(box.getPositionRef()->getX() - cameraX,
				box.getPositionRef()->getY() - cameraY, true);
}

bool Planet::isDead() {
	return hitPoints < 0;
}
